/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ve.com.cantv.worktables.ejb.entity;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Ghust
 */
@Entity
@Table(name = "activity_file")
@NamedQueries({@NamedQuery(name = "ActivityFile.findAll", query = "SELECT a FROM ActivityFile a"), @NamedQuery(name = "ActivityFile.findById", query = "SELECT a FROM ActivityFile a WHERE a.id = :id"), @NamedQuery(name = "ActivityFile.findByFile", query = "SELECT a FROM ActivityFile a WHERE a.file = :file"), @NamedQuery(name = "ActivityFile.findByFileExtension", query = "SELECT a FROM ActivityFile a WHERE a.fileExtension = :fileExtension"), @NamedQuery(name = "ActivityFile.findByFileName", query = "SELECT a FROM ActivityFile a WHERE a.fileName = :fileName")})
public class ActivityFile implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "file")
    private BigInteger file;
    @Column(name = "file_extension")
    private String fileExtension;
    @Column(name = "file_name")
    private String fileName;
    @JoinColumn(name = "id_activity", referencedColumnName = "idactivity")
    @ManyToOne(optional = false)
    private Activity idActivity;

    public ActivityFile() {
    }

    public ActivityFile(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public BigInteger getFile() {
        return file;
    }

    public void setFile(BigInteger file) {
        this.file = file;
    }

    public String getFileExtension() {
        return fileExtension;
    }

    public void setFileExtension(String fileExtension) {
        this.fileExtension = fileExtension;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public Activity getIdActivity() {
        return idActivity;
    }

    public void setIdActivity(Activity idActivity) {
        this.idActivity = idActivity;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ActivityFile)) {
            return false;
        }
        ActivityFile other = (ActivityFile) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ve.com.cantv.worktables.ejb.entity.ActivityFile[id=" + id + "]";
    }

}
